<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<title>MarkDown 编辑器</title>
<script src="./examples/js/jquery.min.js"></script>
<script src="./editormd.min.js"></script>
<script type="text/javascript">
	function isSupportFileApi() {
		return (window.File && window.FileList && window.FileReader && window.Blob);
	}
    function onDrop(e) {
		e.stopPropagation();
		e.preventDefault();

		var file = e.dataTransfer.files[0];
		var reader = new FileReader();
		reader.onload = function () {
			if (editor) editor.setMarkdown(this.result);
		};
		reader.readAsText(file);
	}
	function onDragOver(e) {
		e.stopPropagation();
		e.preventDefault();
	}
	var editor = undefined;
    $(function() {
        editor = editormd("editormd", {
			width   : "100%",
            height  : 2160,
            syncScrolling : "single",
            path : "./lib/"
        });
        if (isSupportFileApi()) {
			document.addEventListener('drop', onDrop);
			document.addEventListener('dragover', onDragOver);
        }
    });
</script>
</head>
<body>
<link rel="stylesheet" href="./css/editormd.min.css" />
<div id="editormd">
    <textarea style="display:none;"></textarea>
</div>
</body>
</html>
